package com.yspa.schedule.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * 健康排程
 * @author Administrator
 *
 */
import org.springframework.web.bind.annotation.ResponseBody;

import com.hsnn.medstgmini.util.Pagination;
import com.yspa.schedule.service.HealthScheduleManager;
/**
 * 健康排程
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/healthSchedule")
public class HealthScheduleController {

	@Autowired
	private HealthScheduleManager manager;
	@Autowired
	private HttpServletRequest request;
	/**
	 * 跳向健康排程列表页面
	 * @return
	 */
	@RequestMapping("/toSchedulePage")
	public String toSchedulePage(){
		return "/yspa/schedule/healthSchedule";
	}
	/**
	 * 获取健康排程列表信息
	 * @return
	 */
	@RequestMapping("/getScheduleList")
	@ResponseBody
	public Pagination getScheduleList(){
		Pagination page = new Pagination(request);
		page.getConditions().put("title", request.getParameter("title"));
		manager.getScheduleList(page);
		return page;
	}
	/**
	 * 根据ID获取信息
	 * @return
	 */
	@RequestMapping("/getDataInfo")
	@ResponseBody
	public Pagination getDataInfo(){
		String id = request.getParameter("id");
		Map<String, Object> obj = manager.getDataInfo(id);
		Pagination page = new Pagination();
		page.setRows(obj);
		return page;
	}
}
